# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: team/kde <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-other
pkgname=qrca
pkgver=0_git20240623
pkgrel=2
_commit=3aa66ae91d8f0624d88d6de0e32ac46927023c8d
pkgdesc="QR-Code scanner for Plasma Mobile"
# armhf blocked by qt5-qtdeclarative
# ppc64le, s390x, riscv64 and loongarch64 blocked by qt5-qtwebengine -> purpose
arch="all !armhf !ppc64le !s390x !riscv64 !loongarch64"
url="https://invent.kde.org/utilities/qrca"
license="GPL-3.0-or-later"
depends="
	kirigami
	kirigami-addons
	purpose
	qqc2-desktop-style
	"
makedepends="
	extra-cmake-modules
	kcontacts-dev
	kcoreaddons-dev
	ki18n-dev
	kirigami-dev
	prison-dev
	purpose-dev
	qt6-qtbase-dev
	qt6-qtdeclarative-dev
	qt6-qtmultimedia-dev
	qt6-qtsvg-dev
	samurai
	zxing-cpp-dev
	"
checkdepends="appstream"
subpackages="$pkgname-lang"
_repo_url="https://invent.kde.org/utilities/qrca.git"
source="https://invent.kde.org/utilities/qrca/-/archive/$_commit/qrca-$_commit.tar.gz"
builddir="$srcdir/$pkgname-$_commit"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

check() {
	ctest --test-dir build --output-on-failure
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
2b670e364304dab1ae31b13bea4828ab9e8a8f6229d19bef759d5099ce51ebe8798cec4d51038725d54f1d7fa92a686068eff903ad2e5ca36be8d519288b38dd  qrca-3aa66ae91d8f0624d88d6de0e32ac46927023c8d.tar.gz
"
